﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include <functional>
#include "GcmpUiViewInterface.h"

namespace gcmp
{
    class IUiView;
    class ElementId;

    /// \brief Ui视图的父控件
    class GCMP_UI_VIEW_INTERFACE_EXPORT IUiViewParent
    {
    public:
        /// \brief 析构函数
        virtual ~IUiViewParent();

        /// \brief 获取Ui视图父控件的id
        ///
        /// \return Ui视图父控件的id
        virtual UInt64 GetId() = 0;

        /// \brief 激活自身，UiView激活后，调用这个接口激活它的父控件
        ///
        /// \return true表示成功， false表示失败
        virtual bool Activate() = 0;

        /// \brief 关闭自身，UiView关闭后，调用这个接口关闭它的父控件
        ///
        /// \param closeReason 关闭的原因
        /// \return true表示成功， false表示失败
        virtual bool Close() = 0;
    };
}
